<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>RealBlog | 自己的博客</title>
<link rel="stylesheet" href="/admin/style/login.css">
<script type="text/javascript" src="/admin/script/crypto-min.js"></script>
<script type="text/javascript" src="/admin/script/crypto-sha1.js"></script>
<script type="text/javascript" src="/admin/script/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
function login()
{
    // 取用户名和密码，一次哈希
    var source = $('#username').val() + $('#password').val();
    var bytes = Crypto.SHA1(source, { asBytes: true });
    var hash = Crypto.util.bytesToHex(bytes);

    // 取时间，二次哈希
    var now = new Date();
    var dateStr = now.getYear() + '/' + now.getMonth() + '/' + now.getDay();

    source = hash + dateStr;
    bytes = Crypto.SHA1(source, { asBytes: true });
    hash = Crypto.util.bytesToHex(bytes);

    $('#date').val(dateStr);
    $('#passwordHash').val(hash);

    document.forms[0].submit();
}
</script>
</head>

<body>
<div id="startpage" class="clearfix">
    <div id="startpage-wrap">
        <h1 id="logo-startpage">RealBlog</h1>
        <div id="login-wrap">
            <form id="login-form" class="clearfix" method="post">
                <div class="input-wrap" id="input-login-email">
                    <span class="input-icon"></span>
                    <label>用户名</label>
                    <input class="startpage-input-text" type="text" id="username" name="username" value="" />
                    <div class="tip" style="display:none"></div>
                </div>
                <div class="input-wrap" id="input-login-pwd">
                    <span class="input-icon"></span>
                    <label>密码</label>
                    <input class="startpage-input-text" type="password" id="password"/>
                    <div class="tip" style="display:none"></div>
                </div>
                <input id="date" name="date" type="hidden" />
                <input id="passwordHash" name="passwordHash" type="hidden" />
                <input type="submit" id="login-submit" class="input-button" onclick="login()" value="登录" />
            </form>
        </div>
        <div id="footer">
        </div>
    </div>
</div>
</body>
</html>